$("#username").change(function () {
    $.ajax({
        url: "/blog/users/validUsername?username=" + this.value,
        success: function(data){
			if(data.success == false){
                toastr.error(data.message);
			}
        },
        error : function(data) {
            toastr.error("error!");
        }
    });
})


$("#email").change(function () {
    $.ajax({
        url: "/blog/users/validEmail?email=" + this.value,
        success: function(data){
            if(data.success == false){
                toastr.error(data.message);
            }
        },
        error : function(data) {
            toastr.error("error!");
        }
    });
})